<!DOCTYPE html><html><head><title>Ext.Base | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
<style type="text/css">.head-band { display: none; }
.header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
.doc-tab .members .member a.more { background-color: #efefef; }
</style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
</head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
<a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">

    req = {
        liveURL: '.',
        standAloneMode: true,
        origDocClass: 'Ext.Base',
        docClass: 'Ext.Base',
        docReq: 'Ext.Base',
        version: '4.0',
        baseURL: '.',
        baseDocURL: '.',
        baseProdURL: '.'
    };

    clsInfo = {};



</script>

<script type="text/javascript" src="../search.js"></script>
<!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
<script type="text/javascript" src="../class_tree.js"></script>
<script type="text/javascript" src="../class_doc.js"></script>
<script type="text/javascript">
    req.source = 'Base3.html#Ext-Base';
    clsInfo = {"methods":["callOverridden","getName"],"cfgs":[],"properties":["addStatics","borrow","create","createAlias","implement","override"],"events":[],"subclasses":["Ext.form.action.Action","Ext.slider.Thumb","Ext.env.Browser"]};
    Ext.onReady(function() {
        Ext.create('Docs.classPanel');
    });
</script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/Base3.html#Ext-Base" target="_blank">Ext.Base</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>The root of all classes created with <a href="Ext.html#define" rel="Ext#define" class="docClass">Ext.define</a>
All prototype and static members of this class are inherited by any other class</p>
<div class="members"><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-addStatics" class="member f ni"><a href="Ext.Base.html#property-addStatics" rel="property-addStatics" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-addStatics" class="viewSource">view source</a></div><a name="addStatics"></a><a name="property-addStatics"></a><a href="Ext.Base.html#" rel="property-addStatics" class="cls expand">addStatics</a><span> : Function</span></div><div class="description"><div class="short">Add / override static properties of this class.

Ext.define('My.cool.Class', {
    ...
});

My.cool.Class.addStatics(...</div><div class="long"><p>Add / override static properties of this class.</p>

<pre><code>Ext.define('My.cool.Class', {
    ...
});

My.cool.Class.addStatics({
    someProperty: 'someValue',      // My.cool.Class.someProperty = 'someValue'
    method1: function() { ... },    // My.cool.Class.method1 = function() { ... };
    method2: function() { ... }     // My.cool.Class.method2 = function() { ... };
});
</code></pre>
</div></div></div><div id="property-borrow" class="member ni"><a href="Ext.Base.html#property-borrow" rel="property-borrow" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-borrow" class="viewSource">view source</a></div><a name="borrow"></a><a name="property-borrow"></a><a href="Ext.Base.html#" rel="property-borrow" class="cls expand">borrow</a><span> : Function</span></div><div class="description"><div class="short">Borrow another class' members to the prototype of this class.

Ext.define('Bank', {

money: '$$$',
printMoney: functi...</div><div class="long"><p>Borrow another class' members to the prototype of this class.</p>

<p>Ext.define('Bank', {</p>

<pre><code>money: '$$$',
printMoney: function() {
    alert('$$$$$$$');
}
</code></pre>

<p>});</p>

<p>Ext.define('Thief', {</p>

<pre><code>...
</code></pre>

<p>});</p>

<p>Thief.borrow(Bank, ['money', 'printMoney']);</p>

<p>var steve = new Thief();</p>

<p>alert(steve.money); // alerts '$$$'
steve.printMoney(); // alerts '$$$$$$$'</p>
</div></div></div><div id="property-create" class="member ni"><a href="Ext.Base.html#property-create" rel="property-create" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-create" class="viewSource">view source</a></div><a name="create"></a><a name="property-create"></a><a href="Ext.Base.html#" rel="property-create" class="cls expand">create</a><span> : Function</span></div><div class="description"><div class="short">Create a new instance of this Class.
Ext.define('My.cool.Class', {

...


});

My.cool.Class.create({

someConfig: tr...</div><div class="long"><p>Create a new instance of this Class.
Ext.define('My.cool.Class', {</p>

<pre><code>...
</code></pre>

<p>});</p>

<p>My.cool.Class.create({</p>

<pre><code>someConfig: true
</code></pre>

<p>});</p>
</div></div></div><div id="property-createAlias" class="member ni"><a href="Ext.Base.html#property-createAlias" rel="property-createAlias" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-createAlias" class="viewSource">view source</a></div><a name="createAlias"></a><a name="property-createAlias"></a><a href="Ext.Base.html#" rel="property-createAlias" class="cls expand">createAlias</a><span> : Function</span></div><div class="description"><div class="short">Create aliases for existing prototype methods. Example:

Ext.define('My.cool.Class', {
    method1: function() { ... ...</div><div class="long"><p>Create aliases for existing prototype methods. Example:</p>

<pre><code>Ext.define('My.cool.Class', {
    method1: function() { ... },
    method2: function() { ... }
});

var test = new My.cool.Class();

My.cool.Class.createAlias({
    method3: 'method1',
    method4: 'method2'
});

test.method3(); // test.method1()

My.cool.Class.createAlias('method5', 'method3');

test.method5(); // test.method3() -&gt; test.method1()
</code></pre>
</div></div></div><div id="property-implement" class="member ni"><a href="Ext.Base.html#property-implement" rel="property-implement" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-implement" class="viewSource">view source</a></div><a name="implement"></a><a name="property-implement"></a><a href="Ext.Base.html#" rel="property-implement" class="cls expand">implement</a><span> : Function</span></div><div class="description"><div class="short">Add methods / properties to the prototype of this class.

Ext.define('My.awesome.Cat', {
    constructor: function() ...</div><div class="long"><p>Add methods / properties to the prototype of this class.</p>

<pre><code>Ext.define('My.awesome.Cat', {
    constructor: function() {
        ...
    }
});

 My.awesome.Cat.implement({
     meow: function() {
        alert('Meowww...');
     }
 });

 var kitty = new My.awesome.Cat;
 kitty.meow();
</code></pre>
</div></div></div><div id="property-override" class="member ni"><a href="Ext.Base.html#property-override" rel="property-override" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-property-override" class="viewSource">view source</a></div><a name="override"></a><a name="property-override"></a><a href="Ext.Base.html#" rel="property-override" class="cls expand">override</a><span> : Function</span></div><div class="description"><div class="short">Override prototype members of this class. Overridden methods can be invoked via
callOverridden

Ext.define('My.Cat', ...</div><div class="long"><p>Override prototype members of this class. Overridden methods can be invoked via
<a href="Ext.Base.html#callOverridden" rel="Ext.Base#callOverridden" class="docClass">callOverridden</a></p>

<pre><code>Ext.define('My.Cat', {
    constructor: function() {
        alert("I'm a cat!");

        return this;
    }
});

My.Cat.override({
    constructor: function() {
        alert("I'm going to be a cat!");

        var instance = this.callOverridden();

        alert("Meeeeoooowwww");

        return instance;
    }
});

var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
                          // alerts "I'm a cat!"
                          // alerts "Meeeeoooowwww"
</code></pre>
</div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-callOverridden" class="member f ni"><a href="Ext.Base.html#method-callOverridden" rel="method-callOverridden" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-method-callOverridden" class="viewSource">view source</a></div><a name="callOverridden"></a><a name="method-callOverridden"></a><a href="Ext.Base.html#" rel="method-callOverridden" class="cls expand">callOverridden</a>(
<span class="pre">Array/Arguments args</span>)
 : Mixed</div><div class="description"><div class="short">Call the original method that was previously overridden with override

Ext.define('My.Cat', {
    constructor: functi...</div><div class="long"><p>Call the original method that was previously overridden with <a href="Ext.Base.html#override" rel="Ext.Base#override" class="docClass">override</a></p>

<pre><code>Ext.define('My.Cat', {
    constructor: function() {
        alert("I'm a cat!");

        return this;
    }
});

My.Cat.override({
    constructor: function() {
        alert("I'm going to be a cat!");

        var instance = this.callOverridden();

        alert("Meeeeoooowwww");

        return instance;
    }
});

var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
                          // alerts "I'm a cat!"
                          // alerts "Meeeeoooowwww"
</code></pre>
<h3 class="pa">Parameters</h3><ul><li><span class="pre">args</span> : Array/Arguments<div class="sub-desc"><p>The arguments, either an array or the <code>arguments</code> object</p>
</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Mixed</span>&nbsp; &nbsp;<p>Returns the result after calling the overridden method</p>
</li></ul></div></div></div><div id="method-getName" class="member ni"><a href="Ext.Base.html#method-getName" rel="method-getName" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.Base.html" class="definedIn docClass">Ext.Base</a><br/><a href="../source/Base3.html#Ext-Base-method-getName" class="viewSource">view source</a></div><a name="getName"></a><a name="method-getName"></a><a href="Ext.Base.html#" rel="method-getName" class="cls expand">getName</a> : String</div><div class="description"><div class="short">Get the current class' name in string format.

Ext.define('My.cool.Class', {
    constructor: function() {
        al...</div><div class="long"><p>Get the current class' name in string format.</p>

<pre><code>Ext.define('My.cool.Class', {
    constructor: function() {
        alert(this.self.getName()); // alerts 'My.cool.Class'
    }
});

My.cool.Class.getName(); // 'My.cool.Class'
</code></pre>
<h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>className</p>
</li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>